Repository navigation
id(range-sync): refuse entry upper bounds over KEY_LEN at frames() and check_bounds (#2595) - #3462
Merged
Merged
Conversation
…d check_bounds (#2595) encode_entry writes the bound length as b.len() as u8 with no KEY_LEN check: bounds of 73..=255 encoded into frames decode_frame itself rejects, and bounds >= 256 wrapped the length byte and garbled the entry stream, while check_bounds approved them all. Add one shared check_bound_len gate (error names the bound length and the 72-byte KEY_LEN limit, following the decoder wording in Reader::entry) called from frames() per entry and from check_bounds() per bound. Tests cover 72 (round-trips through a frame) and 73/100/255/256/300 (refused at both gates, no wrap).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2595 — implementation of the gate pinned by triage task 3842 (queue task 5390).
encode_entrywrote an entry upper bound's length asb.len() as u8with noKEY_LEN(72) check: bounds of 73..=255 encoded into framesdecode_frameitself rejects, bounds ≥ 256 wrapped the length byte and garbled the entry stream, andcheck_boundsapproved them all.check_bound_lengate inpkgs/id/src/event_store/range.rs— refuses a bound longer thanKEY_LENwith an error naming the bound length and the 72-byte limit, following the decoder's wording inReader::entry.frames()per entry (before encoding) and fromcheck_bounds()per bound.test_bounds_over_key_len_are_refused_at_both_gates: a 72-byte bound round-trips through a frame; 73/100/255/256/300 are refused at both gates (the frames error names the length — no wrap).Decoder-side handling, varint canonical form, and sync.rs budgets are untouched, per the packet's scope.
🤖 Agent note · PR opened by queue worker (repo-worker-code), lane B, queue task 5390.
Need help on this PR? Tag
@codesmith-botwith what you need.